<script type="text/javascript">
    TP_JS = '__JS__';
    TP_SKIN = '__SKIN__';
    TP_IMAGES = '__IMAGES__';
    TP_APP = '__APP__';
    TP_URL = '__URL__';
    TP_ADMIN = '__ADMIN__';
    var editor = false;

     SITE_URL = '{$Think.config.SITE_URL}';
    $(function(){
        var act = "{$act}";
        var meth = "{$meth}";

        $('.App-'+act).addClass('active');
        $('.App-'+act+'-'+meth).addClass('active');
        
        ajaxOption = { 
            target:        '#responseText',
            dataType: 'json',
            type:      'POST',
            beforeSubmit:  beforeSubmit,  // pre-submit callback 
            success:       afterComplete
        };   
        jQuery('#baseForm').ajaxForm(ajaxOption);
        // 删除确认
        $('.date-delete').live('click', function(){
            if(!confirm("Are you sure?")){
                return false;  
            } else {
                
            }
        });
        // 日历
        $('.datepicker').datepicker({
            format: 'yyyy-mm-dd'
        });
        //绑定过滤表单提交事件
//        $('#filterbox').submit(
//        function () {
//            $(this).find('.btn-submit').click(); 
//            return false;
//        }
//    );
        // clp 按钮组绑定事件
        $('.clp .btn').bind('click', function(){
            $(this).parent().find('.btn').removeClass('active');
            $(this).addClass('active');
        });
        $('.timeIntevel .btn').bind('click',function(){
            var timestamp = Date.parse(new Date());
            var title = $(this).attr('title');
            $('#begin').val(title);
            $('.btn-submit').click(); 
        });
        $('.appIntevel .btn').bind('click', function(){
            var title = $(this).attr('title');
            $('#appnum').val(title);
            $('.btn-submit').click(); 
        });
        $('.delete-image').bind('click', function(){
            $(this).parent().find('input').val('');
            $(this).parent().find('.upload-img').empty();
        });
    });
</script>
<div id="responseText" style="display: none"></div>